<template>
  <div class="not-found-con">
    <h1>404</h1>
    <h2>好像, 可能, 应该我们真的走错了!</h2>
    <ul>
      <li class="go-to-home">
        <button @click="go2Home">
          返回首页
        </button>
      </li>
      <li class="go-to-refresh">
        <button @click="go2Refresh">
          点击刷新
        </button>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  methods: {
    go2Home () {
      this.$router.push({ name: 'main' })
    },
    go2Refresh () {
      location.reload()
    }
  }
}
</script>

<style lang="less" scoped>
@color: #444;

.not-found-con {
  h1 {
    font-size: 200px;
    color: @color;
    text-align: center;
    padding-top: 100px;
  }

  h2 {
    font-size: 30px;
    color: @color;
    text-align: center;
    letter-spacing: 20px;
  }

  ul {
    display: flex;
    justify-content: center;
    padding-top: 20px;

    .go-to-home, .go-to-refresh {
      width: 120px;
      height: 30px;
    }

    button {
      padding: 10px;
      text-align: center;
      text-decoration: none;
      color: @color;
      border: 2px solid @color;
      font-size: 18px;
      display: inline-block;
      border-radius: 10px;
      transition: all 0.2s ease-in-out;
      position: relative;
      overflow: hidden;
      &:before {
        content: "";
        background-color: rgba(255,255,255,0.5);
        height: 100%;
        width: 100%;
        display: block;
        position: absolute;
        top: 0;
        left: -4.5em;
        transform: skewX(-45deg) translateX(0);
        transition: none;
        cursor: pointer;
      }
      &:hover {
        background-color: @color;
        color: #fff;
        border-bottom: 4px solid darken(@color, 10%);
        &:before {
          transform: skewX(-45deg) translateX(13.5em);
          transition: all 0.5s ease-in-out;
        }
      }
    }
  }
}

@keyframes sheen {
  0% {
    transform: skewY(-45deg) translateX(0);
  }
  100% {
    transform: skewY(-45deg) translateX(12.5em);
  }
}
</style>
